package com.killer_jin.core.common.config;

import com.killer_jin.core.common.filter.DemoFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

// 自定义过滤器配置, 也可通过直接在自定义的过滤器类上使用以下注解的方式,二选一即可:
// @WebFilter(filterName = "sessionFilter",urlPatterns = {"/*"})
// 被Spring控制
@Configuration
public class WebComponent2Config {
    /*@Bean
    public FilterRegistrationBean someFilterRegistration1() {
        //新建过滤器注册类
        FilterRegistrationBean registration = new FilterRegistrationBean();
        // 添加我们写好的过滤器
        registration.setFilter( new DemoFilter());
        // 设置过滤器的URL模式
        registration.addUrlPatterns("/*");
        return registration;
    }*/

}
